package com.flynn.rock.system.convert;

import com.flynn.rock.model.dto.system.RoleDto;
import com.flynn.rock.system.entity.SysRoleEntity;
import com.flynn.rock.system.model.vo.RoleListVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public abstract class AbstractRoleConvert {

    public static final AbstractRoleConvert INSTANCE = Mappers.getMapper(AbstractRoleConvert.class);

    @Mapping(target = "roleStatus", source = "status")
    public abstract RoleListVo toRoleListVo(SysRoleEntity entity);

    @Mapping(target = "roleStatus", source = "status")
    public abstract RoleDto toRoleDto(SysRoleEntity entity);
}
